﻿using System.Data;

namespace DataProvider
{
    public enum DataProvider
    {
        None, Oracle, SqlServer, OleDb, Odbc, MySql
    }
    public interface IDBManager
    {
        DataProvider ProviderType
        {
            get;
            set;
        }

        string ConnectionString
        {
            get;
            set;
        }

        IDbConnection Connection
        {
            get;
        }
        IDbTransaction Transaction
        {
            get;
        }

        IDataReader DataReader
        {
            get;
        }
        IDbCommand Command
        {
            get;
        }

        IDbDataParameter[] Parameters
        {
            get;
        }

        void Open();
        void BeginTransaction();
        void CommitTransaction();
        void RollBackTransaction();
        IDbDataParameter CreateParameter(string parameterName, object parameterValue);
        void SetParameters(IDbDataParameter[] lstParameters);
        IDataReader ExecuteReader(CommandType commandType, string commandText, int commandTimeOut);
        DataSet ExecuteDataSet(CommandType commandType, string commandText, int commandTimeOut);
        object ExecuteScalar(CommandType commandType, string commandText, int commandTimeOut);
        int ExecuteNonQuery(CommandType commandType, string commandText, int commandTimeOut);
        void CloseReader();
        void Close();
        void Dispose();
    }
}
